package org.msb.accentis.gui.views;



import javax.swing.JTable;
import javax.swing.table.TableModel;

import org.msb.accentis.data.CurrencyDecimal;
import org.msb.accentis.data.pojo.Account;
import org.msb.accentis.gui.Resources;
import org.msb.accentis.gui.managedialog.AbstractManageDialogPage;
import org.msb.accentis.gui.managedialog.ManageAccountDialogPage;
import org.msb.accentis.gui.managedialog.ManagePojoDialog;
import org.msb.accentis.gui.swing.CurrencyDecimalTableCellRenderer;

public class AccountsView extends BasicView<Account> {

	public AccountsView(ManagePojoDialog dialog) {
		super("accounts", dialog);
	}

	@Override
	public String getActionResourceKey() {
		return "action.view.accounts";
	}
	
	@Override
	public TableModel createTableModel() {
		return new AccountTableModel();
	}
	
	@Override
	public AbstractManageDialogPage<Account> createManageDialogPage() {
		return new ManageAccountDialogPage(getManagePojoDialog());
	}

	@Override
	protected String getViewTitleCaption() {
		return Resources.getInstance().getString("accountsview.title.caption");
	}

	@Override
	protected void additionalTableCustomizations(JTable table) {
		table.setDefaultRenderer(CurrencyDecimal.class, new CurrencyDecimalTableCellRenderer());
	}
}
